import fetch from '@/utils/fetch';
import { ajax } from '@/utils/trip/ajax'

export function addDictionary(obj) {
    return fetch({
      url: '/api/admin/sys/dict/list',
      method: 'post',
      data: obj
    });
}
export function getDictionaryExcel() {
    return fetch({
      url: '/api/admin/sys/dict/type/excel',
      method: 'get',
    });
}

export function putDictionaryExcel(obj) {
    return fetch({
      url: '/api/admin/sys/dict/type/excel',
      method: 'put',
      data: obj
    });
}
export function getDictionaryExcelTemplate() {
    return fetch({
      url: '/api/admin/sys/dict/type/excel',
      method: 'get',
    });
}
export function deleteAllDictionary(ids) {
    return fetch({
      url: '/api/admin/sys/dict/type/',
      method: 'delete',
      data:ids
    });
}
export function listAllDictionary() {
    return fetch({
      url: '/api/admin/sys/dict/type/list',
      method: 'get',
    });
}
export function getDictionaryTable(query) {
    return fetch({
      url: '/api/admin/sys/dict/type/pageList',
      method: 'get',
      params:query
    });
}
export function delDictionary(id) {
    return fetch({
      url: '/api/admin/sys/dict/type/'+id,
      method: 'delete',
    });
}
export function getDictionary(id) {
  console.log("id======================"+id);
    return fetch({
      url: '/api/admin/sys/dict/'+id,
      method: 'get',
    });
}
export function putDictionary(id,obj) {
  console.log("id======================"+id+"   obj:"+obj);
    return fetch({
      url: '/api/admin/sys/dict/type/'+id,
      method: 'put',
      data:obj
    });
}
